// 用于管理首页模块的相关接口

import request from "@/utils/request"
import type { HospitalResponseData,HospitalLevelAndRegionResponseData,HospitalInfoData } from './type'

// 通过枚举管理首页模块的接口地址
enum API {
    //获取医院数据
    HOSPITAL_URL = '/hosp/hospital/',
    //获取医院等级目录和地区目录数据
    HOSPITAL_LEVEL_REGION_URL = '/cmn/dict/findByDictCode/',
    //根据关键字模糊匹配医院数据
    HOSPITAL_KEY_INFO_URL = '/hosp/hospital/findByHosname/'
}



// 获取医院数据
export const reqHospital = ( page: number, limit: number, hostype = '', districtCode = '' ) => request.get<any,HospitalResponseData>(API.HOSPITAL_URL + `${page}/${limit}?hostype=${hostype}&districtCode=${districtCode}`)

// 获取医院等级目录和地区目录数据
export const reqHospitalLevelRegionData=(dictCode: string)=>request.get<any,HospitalLevelAndRegionResponseData>(API.HOSPITAL_LEVEL_REGION_URL + dictCode)

// 获取医院等级目录和地区目录数据
export const reqHospitalKeyInfoData=(hosName: string)=>request.get<any,HospitalInfoData>(API.HOSPITAL_KEY_INFO_URL + hosName)